package 实验四;

public class Lab {
	String name;
	char[] weisheng;
	public int gongzi=0;
	Lab (String n, char[] ws){//构造函数
		name=n;
		weisheng=ws;
		for(char c:ws){
			if(c=='A'){
				gongzi+=300;
			}
			if(c=='B'){
				gongzi+=200;
			}
			if(c=='C'){
				gongzi+=100;
			}
			if(c=='D'){
				gongzi+=0;
			}
		}
	}

	
	public int getgongzi(){
		return gongzi;
	}
	
	public void display(Lab l){//打印学生某实验室卫生情况
		System.out.println("\n"+this.name+" 18周卫生为：");
		for(char c:l.weisheng){
			System.out.println(c+" ");
		}
	}
}


